<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/css/bootstrap.min.css">

    <link rel="stylesheet" href="./editor/themes/default/default.css">
    <script charset="utf-8" src="./editor/kindeditor-all-min.js"></script>
    <script charset="utf-8" src="./editor/lang/zh-CN.js"></script>
    
    <!-- jQuery文件。务必在bootstrap.min.js 之前引入 -->
    <script src="https://cdn.staticfile.org/jquery/3.2.1/jquery.min.js"></script>    
    <!-- bootstrap.bundle.min.js 用于弹窗、提示、下拉菜单，包含了 popper.min.js -->
    <script src="https://cdn.staticfile.org/popper.js/1.15.0/umd/popper.min.js"></script>    
    <!-- 最新的 Bootstrap4 核心 JavaScript 文件 -->
    <script src="https://cdn.staticfile.org/twitter-bootstrap/4.3.1/js/bootstrap.min.js"></script>
    <style>
        .navbar{
            width: 100%;
            height: 80px;
        }
        .nav-pills{
            float: left;
            width: 60%;
            height: 66px;
            line-height: 51px;
            margin: 0 auto;
        }
        .nav-pills>li{
            text-align: center;
            list-style: none;
            /* width: 4rem; */
            float: left;
        }
        .nav-link{
            display: inline-block;
            /* width: 4rem; */
            color: rgb(255, 255, 255);
            font-weight: bold;
        }
        .actives{
            background-color: #56b9f31c;
        }
        .nav-pills .nav-link.active, .nav-pills .show>.nav-link{
            color: rgb(221, 220, 220);
            background-color: #2badf8;
        }
        .imgbox{
            width: 68%;
            height: 66px;
            float: left;
        }
        .key{
            width: 16px;
            font-size: 16px;
            margin-left: 10px;
        }
        .login>a{
            color: rgb(255, 255, 255);
            text-decoration: none;
        }
        .tou{
            width: 63px;
            height: 63px;
            margin-top: 1px;
            border-radius: 50%;
            border: 1px rgb(147, 144, 144) solid;
            float: left;
        }
        .img{
            width: 180px;
            height: 66px;
            float: left;
            padding-right: 20px;
            margin-left: 120px;
        }
        .cotent{
            width: 1200px;
            height: 100vh;
            margin: 15px auto;
            display: flex;
            justify-content: center;
        }
        .contents{
            display: inline-block;
            border: 1px solid #59f7ff;
        }
        .left{
            width: 800px;
            height: 700px;
            background: white;
        }
        .right{
            width: 350px;
            height: 700px;
            margin-left: 45px;
            align-items: flex-start;
        }
        .box{
            background: rgba(0, 0, 0, 0.5) url(./imge/2.png) no-repeat;
            background-size: 100% 100%;
            opacity: 0.8;
        }
        .serch{
            margin-top: 1px;
            height: 60px;
            width: 100%;
            display: flex;
            align-items: center;
            background: rgba(239, 244, 255, 1);
        }
        .serchbox{
            display: inline-block;
        }
        .serch_left{
            width: 74%;
            display: flex;
            justify-content: center;
            align-items: center;
            
        }
        .serch_right{
            width: 26%;
            margin-left: -1.5%;

        }

        .articl{
            color: #2badf8;
            line-height: 60px;
            padding: 2px 20px;
        }
        .form-inline{
            display: inline-block;
        }
        .mb-2{
            background: rgba(172, 220, 248, 0.2);
            color: rgb(255, 255, 255);
            border-radius: 5px;
            border: 1px #7a99d7 solid;
        }
        input::-webkit-input-placeholder{
            color: #829fdc;
        }
        .btn-primary{
            margin-top: 1px;
            height: 28px;
            line-height: 1px;
            color: #829fdc;
        }
       .footer{
        width: 100%;
        height: 150px;
        background-color: #e3e3e3;
        text-align: center;
        padding: 0.9rem 0;
        font-size: 0.7rem;
       }
       .footer>p{
        opacity: 0.6;
       }
       .title{
            width: 100%;
       }
       .input-group-prepend{
            width: 10%;
       }
       .form-control{
            text-align: center;
       }
       a{
            text-decoration: none;
            color: rgba(55, 55, 240, 0.812);
        }
        a:hover{
            color: #ff6136;
            text-decoration: none;
        }
        .dropdown-toggle{
            margin-left: 1rem;
            width: 10rem;
            height: 30px;
            line-height: 16px;
            background-color: rgb(180, 217, 227);
            color: rgb(81, 80, 80);
            font-weight: 600;
       }
       .dropdown-item{
            height: 2rem;
            font-size: 0.8rem;
            line-height: 1.5rem;
            /* border-bottom: 1px rgb(176, 174, 174) solid; */
       }
       .cheek_ul{
            padding: 0;
       }
       .cheek_span{
            display: inline-block;
            width: 100%;
            height: 2.5rem;
            line-height: 2.5rem;
            font-size: 1rem;
            padding-left: 3rem;
            border-radius: 5px;
            margin-bottom: 15px;
            font-weight: 600;
            color: aliceblue;
            background-color: #07bcc6;
       }
       .cheek_ul>li{
            display: inline-block;
            list-style: none;
            width: 100%;
            height: 2.53rem;
            border-bottom: 1px rgba(186, 174, 174, 0.425) dashed;
            line-height: 2.5rem;
            font-size: 1rem;
            font-weight: 600;
            color: rgba(55, 55, 248, 0.792);
            padding-left: 3rem;
       }
       .image{
            width: 1.3rem;
            margin-top: -5px;
       }
       .img_right{
           margin-left: 3rem;
       }
       .text{
            padding: 0;
       }
       .head{
            display: inline-block;
            width: 100%;
            height: 3rem;
            font-size: 1.5rem;
            border-bottom: 2px rgb(209, 201, 201) solid;
            /* background-color: rgb(78, 23, 23); */
       }
       .text>span>span>img{
            width: 1.5rem;
       }
       .text>span>span{
            display: inline-block;
            margin-top: 10px;
            margin-left: 5px;
            border-bottom: 2px solid rgb(29, 81, 237);
            /* background-color: red; */
       }
       .text>ul{
            padding: 0;
            width: 100%;
            height:100%;
            margin: 1rem auto;
            /* background-color: #04e1ed; */
       }
       .text>ul>li{
            display: inline-block;
            height: 2rem;
            width: 100%;
            text-align: center;
            line-height: 2rem;
            margin-right: 5px;
            /* background-color: #ff6136; */
            list-style: none;
       }
       .auyhorInfo{
            display: inline-block;
            width: 31%;
            height: 10rem;
            border:1px rgba(197, 192, 192, 0.781) solid;
            margin-top: 15px;
            margin-right: 15px;
            box-shadow: 4px 5px 6px -4px;
            padding: 10px; 
       }
       .auyhorInfo>div{
        display: inline-block;
            width: 100%;
            height: 6.7rem;
            border-bottom: 1px rgba(174, 171, 171, 0.658) dashed;
       }
       .auyhorInfo>div>img{
            width: 6rem;
            height: 6rem;
            border: 1px #edadad solid;
            border-radius: 5px;
       }
       .name{
            display: block;
            width: 9rem;
            height: 2rem;
            line-height: 2rem;
            margin-top: 0;
            float: right;
            font-size: 0.6rem;
            /* background-color: #04e1ed; */
       }
       .noGuan{
            display: block;
            width: 5rem;
            height: 1.6rem;
            font-size: 0.9rem;
            text-align: center;
            margin-top: 7px;
            float: right;
            border-radius: 2px;
            line-height: 1.6rem;
            background-color: #04afed;
       }
       .message{
            list-style: none;
            text-align: center;
            margin-top: 2rem;
            color: #9fa6a9;
       }
       .gradeX{
            border-bottom: 1px #8c8a8aba dashed;
       }
       .gradeX>td{
            text-align: center;
       }
       .typ>th{
            text-align: center;
       }
       #myinfo{
            width: 90%;
            height: 70%;
            margin: 5px auto;
            padding: 1rem;
            border: 2px rgba(187, 186, 186, 0.799) dashed;
       }
       #myinfo_ul_1{
            width: 80%;
            height: 3rem;
            padding: 0;
            margin: auto;
            border-bottom: 1px rgb(172, 169, 169) solid;
            /* background-color: #7a99d7; */
       }
       #myinfo_ul_1>li{
            list-style: none;
            width: 32%;
            float: left;
            height: 3rem;
       }
       #myinfo_ul_1>li>span{
            display: inline-block;
            width: 100%;
            height: 3rem;
            text-align: center;
            line-height: 3rem;
            /* background-color: rgb(212, 211, 213); */
            border: 1px rgb(172, 169, 169) solid;
       }
       #myinfo_ul_2{
            width: 80%;
            height: 80%;
            padding: 0;
            margin: auto;
            /* background-color: #04afed; */
       }
       #myinfo_ul_2>li{
            list-style: none;
            width: 100%;
            height: 100%;
            padding-top: 2rem;
            display: none;
            background-color: #ffffff;
       }
       .final_li{
            width: 70%;
            height: 100%;
            margin: auto;
            /* background-color: #04afed; */
       }
       .input-group-prepend,input-group-text{
            display: inline-block;
            width: 6rem;
       }
       .mybut{
        width: 10rem;
        margin-left: 10rem;
        background: rgb(25, 202, 246);
        border: 1px;
        border-radius: 5px;
        height: 2rem;
        color: white;
       }
    </style>
</head>
<body>
    <!-- 登录 -->
    <div class="modal fade" id="myLogin">
        <div class="modal-dialog">
          <div class="modal-content">
       
            <!-- 模态框头部 -->
            <div class="modal-header">
              <h4 class="modal-title"> 用户登录 </h4>
              <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>
       
            <!-- 模态框主体 -->
            <div class="modal-body">
                <form action="" method="post">
                    <div class="input-group mb-3">
                        <div class="input-group-prepend">
                        <span class="input-group-text"> 输入电话 </span>
                        </div>
                        <input type="text" class="form-control" placeholder="Userphone" id="uPhone" name="">
                    </div>
                    <span  class="massge" id="lo_phone"></span>
                    <div class="input-group mb-3">
                        <div class="input-group-prepend">
                        <span class="input-group-text"> 输入密码 </span>
                        </div>
                        <input type="password" class="form-control" placeholder="Userpassword" id="uPass" name="">
                    </div>
                    <span  class="massge" id="lo_pass"></span>
                </form>
            </div>
       
            <!-- 模态框底部 -->
            <div class="modal-footer">
              <button type="button" class="btn btn-secondary" id="login"> 登 录 </button>
            </div>
       
          </div>
        </div>
    </div>
    <script>
        $("#login").click(function(){
            var userPhone = $("#uPhone").val();
            var userPass = $("#uPass").val();
            var flag = true;
            var myreg=myreg = /^(((13[0-9]{1})|(14[0-9]{1})|(17[0]{1})|(15[0-3]{1})|(15[5-9]{1})|(18[0-9]{1}))+\d{8})$/;
            var message = "";
            if(userPhone == ''){
                message = "手机号码不能为空！";
                $('#lo_phone').text(message);
                return flag = false
            }else{
                $('#lo_phone').text('')
            }
            if(userPhone.length !=11){
                message = "请输入有效的手机号码！";
                $('#lo_phone').text(message);
                return flag = false
            }else{
                $('#lo_phone').text('')
            } 
            if(!myreg.test(userPhone)){
                message = "请输入有效的手机号码！";
                $('#lo_phone').text(message);
                return flag = false
            }else{
                $('#lo_phone').text('')
            }
            if(userPass == ''){
                message = "密码不能为空！";
                $('#lo_pass').text(message);
                return flag = false
            }else{
                $('#lo_pass').text('');
            }
            if(flag == true){
                $.ajax({
                    url: "http://cms.com:8081/index/index/userLogin",
                    type: "POST",
                    data: {
                        userPhone,
                        userPass
                    },
                    success: function (data) {
                        if(data == 3){
                            alert('账号已被禁用！');
                            window.location.reload()
                            return
                        }
                        if(data == 0){
                            alert('还没有注册！');
                            window.location.reload()
                            return
                        }
                        if(data == 2){
                            alert('账号或密码错误！');
                            window.location.reload()
                            return
                        }else{
                            var name = JSON.parse(data)
                            $("#userName").text(name.val.userName)
                            localStorage.setItem('void',name.key)
                            window.location.reload()
                            // console.log(name)
                        }
                    }
                }); 
            }
             
        })
    
        function init(){
            var res = localStorage.getItem('void');
            if(res != ''){
                $.ajax({
                    url: "http://cms.com:8081/index/index/getUserInfo",
                    type: "POST",
                    data: {
                        res
                    },
                    success: function (data) {
                        if(data != 0){
                            var name = JSON.parse(data)
                            $("#userName").text(name.userName)
                            $("#author").val(name.userName)
                            $("#del").remove()
                        } 
                    }
                });
            }
        }
        init()
    
        function mian(){
            var res = localStorage.getItem('void');
            if(res != ''){
                $.ajax({
                    url: "http://cms.com:8081/index/index/delUserInfo",
                    type: "POST",
                    data: {
                        res
                    },
                    success: function (data) {
                        if(data == 0){
                            alert('没有登录，快去登录！')
                            console.log(data)
                        }else{
                            var name = JSON.parse(data)
                            $("#userName").text(name.userName)
                            $("#useAavatar").attr('src','http://cms.com:8081/static/uploads/'+name.useAavatar)
                            localStorage.removeItem('void')
                            alert('退出成功！')
                            window.location.reload()
                        }
                        
                    }
                });
            }
        }
        getAavatar()
        function getAavatar(){
            var res = localStorage.getItem('void');
            if(res != null){
                $.ajax({
                    url:"http://cms.com:8081/index/index/getAavatar",
                    type:"POST",
                    data:{
                        redis:res
                    },
                    success:function(data){
                        var res = JSON.parse(data)
                        // console.log(res)
                        if(res.useAavatar != null){
                            $("#tou").attr('src','')
                            $("#changetou").attr('src','')
                            $("#tou").attr('src','http://cms.com:8081/../static/uploads/'+res.useAavatar)
                            $("#changetou").attr('src','http://cms.com:8081/../static/uploads/'+res.useAavatar)
                        }
                        
                    }
                });
            }
            
        }
    </script>
    <!-- 注册 -->
    <div class="modal fade" id="mySign">
        <div class="modal-dialog">
          <div class="modal-content">
       
            <!-- 模态框头部 -->
            <div class="modal-header">
              <h4 class="modal-title"> 用户注册 </h4>
              <button type="button" class="close" data-dismiss="modal">&times;</button>
            </div>
       
            <!-- 模态框主体 -->
            <div class="modal-body">
                <form action="" method="post">
                    <div class="input-group mb-3">
                        <div class="input-group-prepend">
                        <span class="input-group-text"> 输入电话 </span>
                        </div>
                        <input type="text" class="form-control" placeholder="Userphone" id="phone" name="">
                    </div>
                    <span  class="massge" id="ph_phone"></span>
                    <div class="input-group mb-3">
                        <div class="input-group-prepend">
                        <span class="input-group-text"> 输入昵称 </span>
                        </div>
                        <input type="text" class="form-control" placeholder="Username" id="name" name="">
                    </div>
                    <span  class="massge" id="na_name"></span>
                    <div class="input-group mb-3">
                        <div class="input-group-prepend">
                        <span class="input-group-text"> 输入密码 </span>
                        </div>
                        <input type="password" class="form-control" placeholder="Userpassword" id="pass" name="">
                    </div>
                    <span  class="massge" id="pa_pass"></span>
                    <div class="input-group mb-3">
                        <div class="input-group-prepend">
                        <span class="input-group-text"> 确认密码 </span>
                        </div>
                        <input type="password" class="form-control" placeholder="Userpassword" id="repass" name="">
                    </div>
                    <span  class="massge" id="re_pass"></span>
                </form>
            </div>
       
            <!-- 模态框底部 -->
            <div class="modal-footer">
              <button type="button" class="btn btn-secondary" id="sign"> 注 册 </button>
            </div>
       
          </div>
        </div>
    </div>
    <script>
        $("#sign").click(function(){
            var userPhone = $("#phone").val();
            var userName = $("#name").val();
            var userPass = $("#pass").val();
            var userRePass = $("#repass").val();
            var flag = true;
            var myreg=myreg = /^(((13[0-9]{1})|(14[0-9]{1})|(17[0]{1})|(15[0-3]{1})|(15[5-9]{1})|(18[0-9]{1}))+\d{8})$/;
            var message = "";
            if(userPhone == ''){
                message = "手机号码不能为空！";
                $('#ph_phone').text(message);
                return flag = false
            }else{
                $('#ph_phone').text('')
            }
            if(userPhone.length !=11){
                message = "请输入有效的手机号码！";
                $('#ph_phone').text(message);
                return flag = false
            }else{
                $('#ph_phone').text('')
            } 
            if(!myreg.test(userPhone)){
                message = "请输入有效的手机号码！";
                $('#ph_phone').text(message);
                return flag = false
            }else{
                $('#ph_phone').text('')
            }
            if(userName == ''){
                message = "昵称不能为空！";
                $('#na_name').text(message);
                return flag = false
            }else{
                $('#na_name').text('')
            } 
            if(userName.length <2){
                message = "昵称不能小于两个字！";
                $('#na_name').text(message);
                return flag = false
            }else{
                $('#na_name').text('')
            } 
            if(userName.length >5){
                message = "昵称不能多于5个字！";
                $('#na_name').text(message);
                return flag = false
            }else{
                $('#na_name').text('')
            } 
            if(userPass == ''){
                message = "密码不能为空！";
                $('#pa_pass').text(message);
                return flag = false
            }else{
                $('#pa_pass').text('');
            } 
            if(userPass.length <6){
                message = "密码不能少于6位数！";
                $('#pa_pass').text(message);
                return flag = false
            }else{
                $('#pa_pass').text('');
            } 
            if(userPass == ''){
                message = "请再次确认密码！";
                $('#re_pass').text(message);
                return flag = false
            }else{
                $('#re_pass').text('');
            } 
            if(userPass != userRePass){
                message = "两次输入的密码不相同！";
                $('#re_pass').text(message);
                return flag = false
            }else{
                $('#re_pass').text('');
            }
            if(flag == true){
               $.ajax({
                    url: "http://cms.com:8081/index/index/userSign",
                    type: "POST",
                    data: {
                        userPhone,
                        userName,
                        userPass
                    },
                    success: function (data) {
                        if(data==0){
                            alert('已有账号！')
                            window.location.reload()
                            return
                        }
                        if(data==1){
                            alert('注册成功！')
                            window.location.reload()
                        }else{
                            alert('注册失败！')
                            window.location.reload()
                        }
                    }
                }); 
            }
            
        })
    </script>
    <div class="box">
        <header>
            <nav class="navbar navbar-expand-sm" style="background-color:rgba(114, 190, 234, 0.289);font-size: 16px;">
                <div class="imgbox">
                    <img class="img" src="./imge/logo1.png" alt="">
                    <ul class="nav nav-pills" role="tablist" id="tablist">
                        <li class="nav-item">
                            <a class="nav-link actives" href="index.html">网站首页</a>
                            <li class="nav-item">
                                <a class="nav-link actives" href="dome.html">写文章</a>
                            </li>
                        </li>
                    </ul>
                </div>
                <div class="login" style="width: 32%; font-size: 16px;float: right;height: 66px;">
                    <img src="./imge/0.png" alt="" class="tou" id="tou">
                    <div style="float: left; width: 10rem;text-align: center; line-height: 66px;">
                        <div class="dropdown">
                            <span type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown" id="userName">
                              
                            </span>
                            <div class="dropdown-menu" style="background-color:rgb(215, 236, 247); padding-bottom: 0;" id="bacLogin">
                              <!-- <a href="javascript:;" class="dropdown-item" >修改密码</a>
                              <a href="javascript:;" class="dropdown-item" >上传头像</a> -->
                              <span id="deLogin" onclick="mian()" class="dropdown-item" style="border-top: 1px rgb(123, 122, 122) solid;">退出登录</span>
                            </div>
                        </div>
                    </div>
                    <div style="width: 44%;float:right;line-height: 66px;">
                        <!-- <img src="./imge/write.png" alt="" class="key"><a href="dome.html">写文章</a> -->
                        <span id="del"><img src="./imge/钥匙2_key-two.png" alt="" class="key"><a href="javascript:;" data-toggle="modal" data-target="#myLogin"> 登录</a></span> 
                        <img src="./imge/创建_newlybuild.png" alt="" class="key key2"><a href="javascript:;" data-toggle="modal" data-target="#mySign"> 注册</a> 
                    </div>
                </div>
              </nav>
        </header>
        
        <div class="cotent">
            <aside style="padding: 15px; height:100%;width:22%;background-color: rgba(239, 244, 255,0.8);margin-right: 15px;border: 1px #04e1ed solid;">
                <div style="width: 100%; background-color: #efefef;height: 100%;border-radius: 5px;">
                    <ul class="cheek_ul">
                        <span class="cheek_span"><img src="./imge/config.png" alt="" class="image"> 资料设置</span>
                        <li onclick="box(1)" style="border-top: 1px rgba(186, 174, 174, 0.425) dashed;"><img class="image" src="./imge/id-card.png" alt=""> 个人资料<img id="right_1" class="image img_right" src="./imge/_right-one.png" alt=""></li>
                        <li onclick="box(2)"><img class="image" src="./imge/home_setting.png" alt=""> 主页设置<img id="right_2" class="image img_right" src="./imge/right-one.png" alt=""></li>
                    </ul>
                    <ul class="cheek_ul">
                        <span class="cheek_span"><img src="./imge/_star.png" alt="" class="image"> 内容管理</span>
                        <li onclick="box(3)" style="border-top: 1px rgba(186, 174, 174, 0.425) dashed;"><img class="image" src="./imge/my_book.png" alt=""> 我的文章<img id="right_3" class="image img_right" src="./imge/right-one.png" alt=""></li>
                        <li onclick="box(4)"><img class="image" src="./imge/book-one.png" alt=""> 我的文集<img id="right_4" class="image img_right" src="./imge/right-one.png" alt=""></li>
                        <li onclick="box(5)"><img class="image" src="./imge/my_log.png" alt=""> 我的句子<img id="right_5" class="image img_right" src="./imge/right-one.png" alt=""></li>
                        <li onclick="box(6)"><img class="image" src="./imge/grinning-face.png" alt=""> 我的心情<img id="right_6" class="image img_right" src="./imge/right-one.png" alt=""></li>
                    </ul>
                    <ul class="cheek_ul">
                        <span class="cheek_span"><img src="./imge/settings.png" alt="" class="image"> 互动收藏</span>
                        <li onclick="box(7)" style="border-top: 1px rgba(186, 174, 174, 0.425) dashed;"><img class="image" src="./imge/envelope-one.png" alt=""> 我的消息<img id="right_7" class="image img_right" src="./imge/right-one.png" alt=""></li>
                        <li onclick="box(8)"><img class="image" src="./imge/personal-collection.png" alt=""> 我的关注<img id="right_8" class="image img_right" src="./imge/right-one.png" alt=""></li>
                        <li onclick="box(9)"><img class="image" src="./imge/my_star.png" alt=""> 我的收藏<img id="right_9" class="image img_right" src="./imge/right-one.png" alt=""></li>
                    </ul>
                </div>
            </aside>
            <article style="height:100%;width: 80%;background-color: rgba(239, 244, 255, 0.8);padding: 15px 1rem;overflow: auto;display:flex;flex-direction: column;justify-content: flex-start;align-items: center;border: 1px #04e1ed solid;padding-top: 0;">
                <div style="width: 100%;height:100%;border-radius: 5px;">
                    <ul>
                        
                    </ul>
                    <ul class="text" id="text_1" style="background-color: #efefef;width: 100%;height: 100%;display: block;border-radius: 5px;">
                        <span class="head"><span><img src="./imge/id-card.png" alt="">个人资料</span></span>
                        <div id="myinfo">
                            <ul id="myinfo_ul_1">
                                <li onclick="editmyinfo(1)"><span id="x1" class="y" style="background-color: white;border-bottom: 0;">基本信息</span></li>
                                <li onclick="editmyinfo(2)" style="margin: 0 12px;"><span id="x2" class="y">修改密码</span></li>
                                <li onclick="editmyinfo(3)"><span id="x3" class="y">头像修改</span></li>
                            </ul>
                            <ul id="myinfo_ul_2">
                                <li class="myinfo_ul_2_li" id="libox_1" style="display: block;">
                                    <div class="final_li">
                                        <div class="input-group mb-3">
                                            <div class="input-group-prepend">
                                              <span class="input-group-text">昵称</span>
                                            </div>
                                            <input type="text" class="form-control" id="usr" value="">
                                        </div>
                                        <div class="input-group mb-3">
                                            <div class="input-group-prepend">
                                              <span class="input-group-text">性别</span>
                                            </div>
                                            <select name="" id="radio" class="form-control">
                                                <option value="保密">保密</option>
                                                <option value="男">男</option>
                                                <option value="女">女</option>
                                            </select>
                                        </div>
                                        <div class="input-group mb-3">
                                            <div class="input-group-prepend">
                                              <span class="input-group-text">生日</span>
                                            </div>
                                            <input type="month" class="form-control" id="month" value="">
                                        </div>
                                        <div class="input-group mb-3">
                                            <div class="input-group-prepend">
                                              <span class="input-group-text">地区</span>
                                            </div>
                                            <input type="text" class="form-control" id="place" value ="">
                                        </div>
                                        <div class="input-group mb-3">
                                            <div class="input-group-prepend">
                                              <span class="input-group-text">个性签名</span>
                                            </div>
                                            <textarea type="text" class="form-control" id="tarea" value=""></textarea>
                                        </div>
                                        <button class="mybut" onclick="SaveMyInfo()">提交</button>
                                    </div>
                                </li>
                                <li class="myinfo_ul_2_li" id="libox_2">
                                    <div class="final_li">
                                        <div class="input-group mb-3">
                                            <div class="input-group-prepend">
                                              <span class="input-group-text">原密码</span>
                                            </div>
                                            <input type="password" class="form-control" id="oldpass">
                                        </div>
                                        <div class="input-group mb-3">
                                            <div class="input-group-prepend">
                                              <span class="input-group-text">旧密码</span>
                                            </div>
                                            <input type="password" class="form-control" id="newpass">
                                        </div>
                                        <div class="input-group mb-3">
                                            <div class="input-group-prepend">
                                              <span class="input-group-text">确认密码</span>
                                            </div>
                                            <input type="password" class="form-control" id="conpass">
                                        </div>
                                        <button class="mybut" onclick="changePass()">提交</button>
                                    </div>
                                </li>
                                <li class="myinfo_ul_2_li" id="libox_3">
                                    <div class="final_li" style="padding-left: 1rem;">
                                        当前头像：
                                        <img src="./imge/0.png" alt="" style="width: 100px;height: 100px;" id="changetou"> 
                                        <hr>
                                        <div style="width: 300px;margin: 1rem 0;border-radius: 5px;height: 2rem;">
                                            <button type="button" id="upload" style="width: 40%;height: 100%;border-radius: 5px;color: #04afed;">选择图片</button>
                                            <button type="button" id="Preview" style="width: 20%;height: 100%;border-radius: 5px;color: #04afed;float: right;">上传</button>
                                        </div>
                                        在线预览：
                                        <img src="" onerror="this.src='./imge/0.png'"" alt="" style="width: 130px;height: 130px;" id="image">
                                        <img src="" onerror="this.src='./imge/0.png'"" alt="" style="width: 100px;height: 100px;margin-top: 30px;" id="image1">
                                        <img src="" onerror="this.src='./imge/0.png'"" alt="" style="width: 70px;height: 70px;margin-top: 60px;" id="image2">
                                    </div>
                                </li>
                                
                            </ul>
                        </div>
                    </ul>
                    <ul class="text" id="text_2" style="background-color: #efefef;width: 100%;height: 100%;display: none;">
                        <span class="head"><span><img src="./imge/home_setting.png" alt="">主页设置</span></span> 
                        <li class="message">暂无消息</li>
                    </ul>
                    <ul class="text" id="text_3" style="background-color: #efefef;width: 100%;height: 100%;display: none;">
                        <span class="head"><span><img src="./imge/my_book.png" alt="">我的文章</span></span> 
                        <div>
                            <table width="100%" style="margin-top: 1rem;">
                                <thead>
                                    <tr class="typ">
                                        <th>序号</th>
                                        <th>文章标题</th>
                                        <th>分类</th>
                                        <th>发表时间</th>
                                        <th>文章状态</th>
                                        <th>删除</th>
                                    </tr>
                                </thead>
                                <tbody  id="example">
                                </tbody>
                            </table>
                        </div>
                    </ul>
                    <ul class="text" id="text_4" style="background-color: #efefef;width: 100%;height: 100%;display: none;">
                        <span class="head"><span><img src="./imge/book-one.png" alt="">我的文集</span></span> 
                    </ul>
                    <ul class="text" id="text_5" style="background-color: #efefef;width: 100%;height: 100%;display: none;">
                        <span class="head"><span><img src="./imge/my_log.png" alt="">我的句子</span></span> 
                    </ul>
                    <ul class="text" id="text_6" style="background-color: #efefef;width: 100%;height: 100%;display: none;">
                        <span class="head"><span><img src="./imge/grinning-face.png" alt="">我的心情</span></span> 
                    </ul>
                    <ul class="text" id="text_7" style="background-color: #efefef;width: 100%;height: 100%;display: none;">
                        <span class="head"><span><img src="./imge/envelope-one.png" alt="">我的消息</span></span> 
                        <div id="myDown"></div>
                    </ul>
                    <ul class="text" id="text_8" style="background-color: #efefef;width: 100%;height: 100%;display: none;">
                        <span class="head"><span><img src="./imge/personal-collection.png" alt="">我的关注</span></span>
                        <div style="width: 100%;height: 100%; " id="auyhorInfo">
                            
                        </div>
                        
                    </ul>
                    <ul class="text" id="text_9" style="background-color: #efefef;width: 100%;height: 100%;display: none;">
                        <span class="head"><span><img src="./imge/my_star.png" alt="">我的收藏</span></span>
                        <ul>
                            <li style="border-bottom: 1px rgba(163, 162, 162, 0.462) solid;">
                                <input type="button" id="checkbox" style="margin-left: -0.9rem;font-size: 0.5rem;height: 1.5rem;line-height: 1rem;" value="全选">
                                <span style="display: inline-block; width: 35rem;padding-left: 1rem;"> 文 章 标 题</span><span>收藏时间</span>
                            </li>
                            <li id="myColect">
                                
                            </li>
                            <!-- <button style="margin-top: 30px;float: right;margin-right: 55px;" id="sub">取消收藏</button> -->
                        </ul>
                    </ul>
                </div>
                
            </article>
            
        </div>
        <div class="footer">
            <p style="font-size: 0.9rem;"> 网站首页 | 关于网站 | 网站地图 </p>
            <p>文字站感谢每一位喜欢本站的人，欢迎将本站分享给你的朋友！最温暖的文字记录站 ─ 文字站！</p>
            <p>本站部分内容来源于互联网，若无意侵犯您的权利，请联系我们及时删除</p>
            <p style="font-size: 0.9rem;">渝ICP备99999999号  Copyright © 2015  文字站   www.xiaowumeiwen.com  版权所有</p>
        </div>
    </div>
    <div style="display: none;">
        <input id="file" type="file" name="image" onchange="uploadFile()">
    </div>
    <script>
        $("#upload").click(function(){
            $("#file").click()
        })
        function uploadFile() {
            var res = localStorage.getItem('void');
            var myform = new FormData();
            myform.append('image',$('#file')[0].files[0]);
            $.ajax({
                url: "http://cms.com:8081/index/index/userPhotoUp?id="+res,
                type: "POST",
                data: myform,
                contentType: false,
                processData: false,
                success: function (data) {
                    var res = JSON.parse(data)
                    $("#image").attr("src",'http://cms.com:8081/static/uploads/'+res)
                    $("#image1").attr("src",'http://cms.com:8081/static/uploads/'+res)
                    $("#image2").attr("src",'http://cms.com:8081/static/uploads/'+res)
                    // console.log(data);
                },
                error:function(data){
                    // console.log(data)
                }
            });
        }
        $("#Preview").click(function(){
            var res = localStorage.getItem('void');
            var src = $("#image")[0].src
            var a = src.split("s/")[1]
            console.log(a)
            if(a){
                var b = a.replace("/","\\")
                console.log(b)
                $.ajax({
                    url: "http://cms.com:8081/index/index/PhotoUp",
                    type: "POST",
                    data:{b,res},
                    success: function (data) {
                        var res = JSON.parse(data)
                        console.log(res)
                        if(res == 1){
                            alert("修改成功")
                            getAavatar()
                        }else{
                            alert("修改失败")
                        }  
                    }
                });
            }else{
                alert("还没有选择图片")
            }  
        })
        getAavatar()
        function getAavatar(){
            var res = localStorage.getItem('void');
            if(res != null){
                $.ajax({
                    url:"http://cms.com:8081/index/index/getAavatar",
                    type:"POST",
                    data:{
                        redis:res
                    },
                    success:function(data){
                        var res = JSON.parse(data)
                        // console.log(res)
                        if(res.useAavatar != null){
                            $("#tou").attr('src','')
                            $("#changetou").attr('src','')
                            $("#tou").attr('src','http://cms.com:8081/../static/uploads/'+res.useAavatar)
                            $("#changetou").attr('src','http://cms.com:8081/../static/uploads/'+res.useAavatar)
                        }
                        
                    }
                });
            }
            
        }        
            
    </script>
    <script>
        var redis = localStorage.getItem('void');
        // console.log(redis)
        function changePass(){
                var oldpass = $("#oldpass").val()
                var newpass = $("#newpass").val()
                var conpass = $("#conpass").val()
                if(oldpass.length==0 || newpass.length ==0 || conpass.length == 0){
                    alert("密码必填")
                    return
                }else if(newpass.length<6){
                    alert("密码必须大于六位")
                    return
                }else if(newpass != conpass){
                    alert("两次密码不相同")
                    return
                }
                if(redis != null){
                    $.ajax({
                        url: "http://cms.com:8081/index/index/changePass",
                        type: "POST",
                        data:{
                            redis,
                            oldpass,
                            newpass,
                            conpass
                        },
                        success: function (data) {
                            var res = JSON.parse(data)
                            console.log(res)
                            if(res == 1){
                                alert("修改成功")
                                $("#oldpass").val('')
                                $("#newpass").val('')
                                $("#conpass").val('')
                            }
                            else{
                                alert("修改失败")
                            }
                        }
                    });
                }
                
            
        }
        function getMyInfo(){
            // var redis = localStorage.getItem('void');
            if(redis != null){
                $.ajax({
                    url: "http://cms.com:8081/index/index/getMyInfo",
                    type: "POST",
                    data:{redis},
                    success: function (data) {
                        var res = JSON.parse(data)
                        // console.log(res)
                        if(res != null){
                            $("#usr").val(res.name)
                            $("#radio").val(res.sex)
                            $("#month").val(res.birth)
                            $("#place").val(res.place)
                            $("#tarea").val(res.sign)
                        }
                        
                    }
                });
            }
            
        }getMyInfo()

        function SaveMyInfo(){
            // var redis = localStorage.getItem('void');
            var usr = $("#usr").val()
            var radio = $("#radio").val()
            var month = $("#month").val()
            var place = $("#place").val()
            var tarea = $("#tarea").val()
            if(redis != null){
                $.ajax({
                    url: "http://cms.com:8081/index/index/SaveMyInfo",
                    type: "POST",
                    data:{
                        usr,
                        radio,
                        month,
                        place,
                        tarea,
                        redis
                    },
                    success: function (data) {
                        var res = JSON.parse(data)
                        console.log(res)
                        if(res==1){
                            alert('保存成功')
                            getMyInfo()
                        }else{
                            alert('保存失败')
                        }
                    }
                });
            }
            
        }
    </script>
    <script type="text/javascript">
        
        // cheeckbox()
        function box(index){
            $(".text").css('display','none')
            $("#text_"+index).css('display','block')
            $(".img_right").attr('src','./imge/right-one.png')
            $("#right_"+index).attr('src','./imge/_right-one.png')
        }
        function editmyinfo(i){
            $(".myinfo_ul_2_li").css('display','none')
            $("#libox_"+i).css('display','block')
            $(".y").css('background','')
            $("#x"+i).css('background','white')
            $("#x"+i).css('border-bottom','0')
        }
        var a=false
        $(function(){
            $("#checkbox").click(function(){
                $(".check_a").prop('checked',!a);
                a=!a
            });
        });
        getArtDown()
        function getArtDown(){
            var redis = localStorage.getItem('void');
            $.ajax({
                url: "http://cms.com:8081/index/index/getArtDown",
                type: "POST",
                data:{id:redis},
                success: function (data) {
                    var res = JSON.parse(data)
                    // console.log(res)
                    if(res.length==0){
                        var $div= '<li class="message">暂无消息</li>'
                        $("#myDown").append($div)
                    }else{
                        $("#myDown").empty()
                        for(var i=0;i<res.length;i++){
                            var $div = '<ul style="width: 100%;list-style: none;padding: 0.5rem;margin-top: 10px;">'+
                                        '<span style="display: inline-block;width: 100%;height: 2rem;text-align: center;">'+res[i].dateline+'</span>'+
                                        '<div  style="width: 100%;height: 1px;border-bottom: 1px rgba(190, 178, 178, 0.633) dashed;;margin-bottom: 1rem;"></div>'+
                                        '<img src="./imge/3.1.png" alt="" style="width: 4rem;border-bottom: 2px #8b7c7c solid;border-radius: 5px;">'+
                                        '<li style="width: 91%;min-height: 4rem;background-color: rgba(220, 204, 204, 0.244);float: right;border: 1px rgba(210, 203, 203, 0.241) solid;">'+
                                        '<span style="display: inline-block;width: 100%;color: #05aeb7;font-size: 0.8rem;">我是你的私人管理小杜君</span>'+
                                        '<span style="display: inline-block;width: 100%;">'+
                                            '<span>亲爱的：<a href="javascript"> '+res[i].artAuthor+' ,</a></span><span> 你的文章：</span>'+
                                            '<a href="">'+res[i].artTitle+'</a>'+
                                            '<span> 因为 <i style="border-bottom: 1px rgb(151, 148, 143) dashed;"> '+res[i].rfDown+' </i> 被平台管理员下架。</span>'+
                                        '</span>'+
                                    '</li>'+
                                '</ul>'
                            $("#myDown").append($div)
                        }
                    }
                    
                }
            }); 
        }
        getMyArt()
        function getMyArt(){
            var redis = localStorage.getItem('void');
            $.ajax({
                url: "http://cms.com:8081/index/index/getMyArt",
                type: "POST",
                data:{id:redis},
                success: function (data) {
                    var res = JSON.parse(data)
                    // console.log(res)
                    $("#example").empty()
                    for(var i=0;i<res.length;i++){
                        if(res[i].artState == 1){
                            var $div = '<tr class="gradeX">'+
                                        '<td>'+(i+1)+'</td>'+
                                        '<td>'+
                                            '<a href="about.html?id='+res[i].artID+'">'+res[i].artTitle+'</a>'+
                                        '</td>'+
                                        '<td>'+res[i].articleType[0].typName+'</td>'+
                                        '<td>'+res[i].dateline+'</td>'+
                                        '<td>发布状态</td>'+
                                        '<td><div class="tpl-table-black-operation">'+
                                            '<a onclick="myArtDel('+res[i].artID+')"><img src="./imge/delete-two.png" alt="" style="width: 1.6rem;margin-top: -3px;"></a>'+
                                            '</div>'+
                                        '</td>'+
                                    '</tr>'
                                    $("#example").append($div)
                        }else{
                            var $div = '<tr class="gradeX">'+
                                        '<td>'+(i+1)+'</td>'+
                                        '<td>'+
                                            '<a href="about.html?id='+res[i].artID+'">'+res[i].artTitle+'</a>'+
                                        '</td>'+
                                        '<td>'+res[i].articleType[0].typName+'</td>'+
                                        '<td>'+res[i].dateline+'</td>'+
                                        '<td style="color: red;">已被下架</td>'+
                                        '<td><div class="tpl-table-black-operation">'+
                                            '<a onclick="myArtDel('+res[i].artID+')"><img src="./imge/delete-two.png" alt="" style="width: 1.6rem;margin-top: -3px;"></a>'+
                                            '</div>'+
                                        '</td>'+
                                    '</tr>'
                                    $("#example").append($div)
                        }
                    }
                }
            });
        }
        function myArtDel(id){
            var result = confirm('确定要删除这篇文章吗？');
            if(result == true){
                var redis = localStorage.getItem('void');
                $.ajax({
                    url: "http://cms.com:8081/index/index/myArtDel",
                    type: "POST",
                    data:{
                        id:id,
                        redis:redis
                    },
                    success: function (data) {
                        var res = JSON.parse(data)
                        if(res == 1){
                            getMyArt()
                        }
                    }
                });
            }
            
            
        }
        getFollow()
        function getFollow(){
            var redis = localStorage.getItem('void');
            $.ajax({
                url: "http://cms.com:8081/index/index/getFollow",
                type: "POST",
                data:{id:redis},
                success: function (data) {
                    var res = JSON.parse(data)
                    // console.log(res)
                    if(res.length==0){
                        $("#auyhorInfo").empty()
                        var $div= '<li class="message">暂无关注</li>'
                        $("#auyhorInfo").append($div)
                    }else{
                        $("#auyhorInfo").empty()
                        for(var i=0;i<res.length;i++){
                            var $div = '<li class="auyhorInfo" >'+
                                            '<div>'+
                                                '<img src="http://cms.com:8081/static/uploads/'+res[i].getUser[0].useAavatar+'" alt="">'+
                                                '<span class="name">昵称：<a href="javascript:;">'+res[i].getUser[0].userName+'</a></span>'+
                                                '<span class="name" style="margin-top: -4rem;">账号：<a href="javascript:;">'+res[i].getUser[0].userPhone+'</a></span>'+
                                                '<span class="name" style="margin-top: -2rem;">关注时间：'+res[i].dateline+'</span>'+
                                            '</div>'+
                                            '<span class="noGuan" onclick="noFollow('+res[i].uID+')">取消关注 </span>'+
                                        '</li>'
                            $("#auyhorInfo").append($div)
                    }
                    }
                    
                }
            }); 
        }
        function noFollow(id){
            var redis = localStorage.getItem('void');
            $.ajax({
                url: "http://cms.com:8081/index/index/noFollow",
                type: "POST",
                data:{
                    id:id,
                    redis:redis
                },
                success: function (data) {
                    var res = JSON.parse(data)
                    if(res == 1){
                        alert('取消成功！')
                        getFollow()
                    }
                }
            });
        }
        function noCollect(id){
            var redis = localStorage.getItem('void');
            $.ajax({
                url: "http://cms.com:8081/index/index/noCollect",
                type: "POST",
                data:{
                    id:id,
                    redis:redis
                },
                success: function (data) {
                    var res = JSON.parse(data)
                    if(res == 1){
                        alert('取消成功！')
                        getColect()
                    }
                }
            });
        }
        getColect()
        function getColect(){
            var redis = localStorage.getItem('void');
            $.ajax({
                url: "http://cms.com:8081/index/index/getCollect",
                type: "POST",
                data:{id:redis},
                success: function (data) {
                    var res = JSON.parse(data)
                    // console.log(res)
                    $("#myColect").empty()
                    for(var i=0;i<res.length;i++){
                        var $li = '<li style="border-bottom: 1px rgba(183, 180, 180, 0.748) dashed;">'+
                                    '<input type="checkbox" value="'+res[i].colArt[0].artID+'" class="check_a">'+
                                    '<span style="display: inline-block; width: 35rem;padding-left: 3.5rem;">'+
                                        '<a href="about.html?id='+res[i].colArt[0].artID+'">'+res[i].colArt[0].artTitle+'</a>'+
                                    '</span>'+
                                    '<span>'+res[i].dateline+'</span>'+
                                    '<img src="./imge/minus.png" alt="" style="width:1rem;margin-right:-2rem;margin-left:2rem;margin-top:-5px;" onclick="noCollect('+res[i].colArt[0].artID+')" title="取消收藏" data-toggle="popover" data-trigger="hover">'+
                                '</li>'
                    $("#myColect").append($li)
                    }
                    
                }
            });
        }
        $(document).ready(function(){
            $('[data-toggle="popover"]').popover();   
        });
        

    </script>

    </body>
</html>
    